package com.rhf.core.commons.logging;

public class AppLogManager {
	/**
	 * Log pour la base de donn�es
	 */
	private static AppLog dbLogger = null;

	/**
	 * Nom du log pour la base de donn�es
	 */
	private static final String DB_LOGGER_NAME = "db";

	/**
	 * Log pour la DAO (Database Access Ojbect)
	 */
	private static AppLog daoLogger = null;

	/**
	 * Nom du log pour la partie DAO (Acc�s � la base de donn�es)
	 */
	private static final String DAO_LOGGER_NAME = "dao";

	/**
	 * Log pour les services
	 */
	private static AppLog servicesLogger = null;

	/**
	 * Nom du log pour les services
	 */
	private static final String SERVICES_LOGGER_NAME = "services";

	/**
	 * Log pour pour l'inferace utilisateur (ui)
	 */
	private static AppLog uiLogger = null;

	/**
	 * Nom du log pour l'ui
	 */
	private static final String UI_LOGGER_NAME = "ui";

	/**
	 * get the database logger
	 * 
	 * @return the database logger
	 */
	public static AppLog getDbLogger() {
		if (dbLogger == null) {
			dbLogger = new AppLog(DB_LOGGER_NAME);
		}

		return dbLogger;
	}

	/**
	 * get the application logger
	 * 
	 * @return the application logger
	 */
	public static AppLog getDaoLogger() {
		if (daoLogger == null) {
			daoLogger = new AppLog(DAO_LOGGER_NAME);
		}

		return daoLogger;
	}

	/**
	 * get the service logger
	 * 
	 * @return the service logger
	 */
	public static AppLog getServiceLogger() {
		if (servicesLogger == null) {
			servicesLogger = new AppLog(SERVICES_LOGGER_NAME);
		}

		return servicesLogger;
	}

	/**
	 * get the ui logger
	 * 
	 * @return the ui logger
	 */
	public static AppLog getUiLogger() {
		if (uiLogger == null) {
			uiLogger = new AppLog(UI_LOGGER_NAME);
		}

		return uiLogger;
	}
}
